<?php
$filename = '../../../resources/json/availablelayers.json';
$layers = @stripslashes(@trim($_REQUEST['layers']));
$obj = json_decode($layers);
$layers = json_encode($obj);
if($layers != '') {
	$fp = fopen($filename, 'w');
	$ret = fwrite($fp, $layers);
	fclose($fp);
	
	if($ret !== false){
		print json_encode( array( "success" => true ) );
	} else {
		print json_encode( array( "success" => false ) );
//		echo 'Not updated correctly';
	}
} else {
	print json_encode( array( "success" => false ) );
//	echo 'Wrong Parameter List Supplied!';
}
?>